 <mettingsa charset="utf-8">

<div class="box box-primary" id="signup_template_formpreview" style="height: 500px;overflow-y: scroll;" >
 			<form  id="signup_submit_form">
 			
 			
              <div class="box-body" id="signup_template_formpreview_render_wrap"> </div>
              
              </form>
              <div class="box-footer">
                <!--  <button type="button" class="btn btn-default pull-right" v-on:click="cancel">关闭</button> -->
                
                <button type="button" class="btn btn-info pull-right" v-on:click="doSubmit">提交</button>
              </div>
</div>
<script type="text/javascript">

new Vue({
    el: '#signup_template_formpreview',
    data:  {
    	metId: null,
	    bus:new Vue()
 }, 
	mounted : function() {
	var _this=this;
	var formDataz=zfesLayerEditDg.getLayerParam().formDataXml;
	_this.metId=zfesLayerEditDg.getLayerParam().metId;
	//var formData= zfesLayerEditDg.getLayerParam().formDataJson;
	  var fbRender = document.getElementById('signup_template_formpreview_render_wrap');
	     var formRenderOpts = {
	    	formData : formDataz,//参数名必须是formData
	    	dataType: 'xml',
	    	  controlConfig: {
		        	 'file.fineuploader': {
				        		js: '/static/lib/fine-uploader/jquery.fine-uploader.min.js',
				        		css: '/static/lib/fine-uploader/fine-uploader.min.css',
				        		handler: '/met/service/tenant/signupDefine/uploadAttaches',
				        		retry: {
				                    enableAuto: false
				                },
				                background:"#FFF",
				                multiple: false,
				        		 callbacks:{
					                onComplete:  function(id,  fileName,  responseJSON)  {
					                	if(responseJSON.success!=true){
					                		alertSwal.errorText("上传失败");
					                		return;
					                	}
					                	var fileUrl=responseJSON.url;
					                	var element=$(this._options.element);
					                	var uploadContainer= $(element).parent()
					                	var inputId=$(element).attr("id").replace("-wrapper","");
					                	var inputEl=$(uploadContainer).find("#"+inputId+"");
					                	$(inputEl).val(fileUrl);
					                }
				        		} ,
				        		validation: {
				                   // allowedExtensions: ['jpeg', 'jpg', 'gif', 'png']
				                }
				        	
				        		// other fine uploader configuration options here
		        		 }
		        	},
	  };
	     $(fbRender).formRender(formRenderOpts);
	  
},
 methods: {
	 doSubmit: function () {
		 var _this=this;
		 if($("#signup_submit_form").valid()){
	    		var param=zfesUtil.formToJson($("#signup_submit_form"));
	    		$.extend( param,{"metId":_this.metId} )
	    		
	    		var url="/met/service/tenant/signupDefine/submitSignup";
	    		zfesAjax.ajaxTodo(url,param, function(data){
	    			alertSwal.successText(data.message);
	    		})
	    	}
	    },
    	    cancel: function(){
    	    	 layer.close(layer.index);
    	    	 
    	    }
}
})

 </script>
